# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=loolwsd
pkgver=6.4.0.2
pkgrel=0
pkgdesc="LibreOffice Online WebSocket server"
url="https://github.com/LibreOffice/online"
arch="all !s390x !mips !mips64 !x86 !armv7 !armhf" #x86 and armv7 fail to build with size errors
license="MPL-2.0"
makedepends="automake autoconf libtool libreofficekit bash py3-lxml py3-polib libpng-dev
	cppunit-dev libcap-dev linux-pam-dev npm openssl-dev krb5-dev poco-dev libseccomp-dev"
subpackages="$pkgname-doc"
source="https://github.com/LibreOffice/online/archive/libreoffice-$pkgver.tar.gz
	10-musl.patch"
builddir="$srcdir/online-libreoffice-$pkgver"

build() {
	./autogen.sh
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--enable-silent-rules \
		--with-lokit-path=/usr/include/libreoffice \
		--with-lo-path=/usr/lib/libreoffice \
		--with-poco-includes=/usr/include/Poco \
		--with-vendor="Alpine Linux" \
		--enable-browsersync \
		--disable-seccomp \
		--disable-setcap \
		--enable-anonymization
	make CXXFLAGS="$CXXFLAGS -DNDEBUG" all-local
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir/" install
}

sha512sums="e2e8846023c314a22fecf1452a8b00854a7fb6c67a61640335e624ee8d14ee934af14a880cf61a5a64f6291a77165a5cc698e861a75d5294b1ff6405161e9dac  libreoffice-6.4.0.2.tar.gz
58c3dfb81913a2ddf995fb8eccd9e4038252b3d29b2f37ed754e1e6f9a9ae5bbcc8464ceaef2e98f916715443fa35305a7ae2925779348231547960ee96cbb91  10-musl.patch"
